package com.springcloud.authorservice.controller;

import com.springcloud.authorservice.pojo.Author;
import com.springcloud.authorservice.service.AuthorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/author")
public class AuthorController {
    @Autowired
    private AuthorService authorService;
    @GetMapping("/{id}")
    public Author getAuthorInfo(@PathVariable Integer id) throws InterruptedException {
        System.out.println("请求进来");
        Thread.sleep(3000);
        return authorService.getAuthorInfo(id);
    }
}